package com.bbc.app;

import android.app.Application;
import android.content.Context;

import com.bbc.callback.CustomCallback;
import com.bbc.callback.EmptyCallback;
import com.bbc.callback.ErrorCallback;
import com.bbc.callback.LoadingCallback;
import com.bbc.callback.TimeoutCallback;
import com.bbc.uitls.UpdateCofig;
import com.kingja.loadsir.callback.SuccessCallback;
import com.kingja.loadsir.core.LoadSir;

/**
 * Created by Administrator on 2017/9/26.
 */

public class BaseApplication extends Application {
    private static Context mContext;

    public static Context getContext() {
        return mContext;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        mContext = getApplicationContext();
        UpdateCofig.init(this);
        LoadSir.beginBuilder()
                .addCallback(new ErrorCallback())
                .addCallback(new EmptyCallback())
                .addCallback(new LoadingCallback())
                .addCallback(new TimeoutCallback())
                .addCallback(new CustomCallback())
                .setDefaultCallback(LoadingCallback.class)
                .commit();
    }
}
